package com.eimf.saf.base.util;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author eden
 * @date 2013-11-19 下午3:15:55
 * @Description: 工具集合类
 */
public class BaseUtil
{

    /**
     * 返回当前时间
     */
    public static String getDateTime()
    {
        String toDay = "";
        try
        {
            final SimpleDateFormat dateformat1 = new SimpleDateFormat(BaseContant.YYYY_MM_DD_HH_MM_SS);
            toDay = dateformat1.format(System.currentTimeMillis());
        } catch (final Exception e)
        {
            e.printStackTrace();
        }
        return toDay;
    }

    /**
     * 
     * 将传入的日期格式化
     * 
     * @param dateInput
     * @return String
     * @exception
     * @since 1.0.0
     */
    public static String getDateTime(final String dateInput)
    {
        String toDay = "";
        Date temp = null;
        try
        {
            final SimpleDateFormat dateformat1 = new SimpleDateFormat(BaseContant.YYYY_MM_DD_HH_MM_SS);
            temp = dateformat1.parse(dateInput);
            toDay = dateformat1.format(temp);
        } catch (final Exception e)
        {
            e.printStackTrace();
        }
        return toDay;
    }

    public static String getFileSeparator()
    {
        return System.getProperty("file.separator");
    }

}
